package com.ujcms.cms.ext.domain.base;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import org.hibernate.validator.constraints.Length;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.lang.Nullable;

import java.io.Serializable;
import java.time.OffsetDateTime;

/**
 * 最基础的顶级Domain
 *
 * @author ZhengLongJian
 * @version 1.0.0
 * @since 2024-07-20 15:02
 */
public class BaseDomain implements Serializable {
    /**
     * 创建人
     */
    @Length(max = 32)
    @Nullable
    @Schema(description="创建人")
    private String createBy;

    /**
     * 修改人
     */
    @Length(max = 32)
    @Nullable
    @Schema(description="修改人")
    private String updateBy;

    /**
     * 创建时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Nullable
    @Schema(description="创建时间")
    private OffsetDateTime createAt;

    /**
     * 更新时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Nullable
    @Schema(description="更新时间")
    private OffsetDateTime updateAt;
}
